1. Field of the Invention
This application relates to the field of filters and more particularly to the field of spurious noise filters for use with magnetic flowmeters.
2. Description of Related Art
Magnetic flowmeters measure the rate of flow of a process fluid through a tube. They operate by detecting small voltage changes induced in a conductive fluid as it passes through a magnetic field imposed by energizing coils mounted on the tube. The induced voltage is proportional to the average velocity of the fluid and to the strength of the imposed magnetic field. Magnetic flowmeters are particularly applicable to monitoring fluids that present difficult handling problems for other metering systems, such as pulp, paste, and slurries.
Because magnetic flowmeter systems operate on small induced voltages, sensor readings are typically amplified and conditioned before presentation to subsequent processing, with an attendant degradation in signal-to-noise ratio. This situation is worsened by the non-homogeneity of some fluids, such as a slurry, for which solid pieces of material suspended in the fluid may come into direct contact with measurement electrodes. Since the solid pieces may be charged, or have a different conductivity than the surrounding fluid, their contact with measurement electrodes can cause spurious noise or xe2x80x9cglitchesxe2x80x9d in measurements, which are not indicative of changes in fluid flow rate.
Glitches are particularly troublesome when the measurement signal is being used in a control process, and may result in inappropriate (and expensive) process interruptions. Known filtering methods apply low pass techniques to reduce the effects of these glitches. In particular a low pass filter, either digitally synthesized or analog, has an attenuated response to an impulse. However, as a significant disadvantage, the response is also extended in duration. The filter may also introduce undesirable delay into measurements for control applications.
There remains a need for a filter that suppresses spurious noise such as input glitches without introducing artifacts of conventional low-pass filters.
According to the principles of the invention, there is provided a system that identifies spurious noise values in an input signal and replaces them with substitute values representative of the spurious-noise-free signal. The system is activated when the signal deviation exceeds a predetermined threshold, otherwise passing the signal unchanged. The substituted representative values are determined based on historical signal data, preferably a moving average with a fixed window. There is further provided a maximum glitch width which prevents inadvertent suppression of a true step in the input signal, and a relaxation time which prevents consecutive filter activations from unduly masking the input signal.
In one aspect, a method for filtering a process sensor signal according to the principles of the invention includes: determining a spurious noise threshold; receiving a process sensor signal; determining a representative value of the process sensor signal; and replacing the process sensor signal with the representative value when a calculated value of the process sensor signal exceeds the spurious noise threshold, thereby providing a processed signal.
In this aspect, the process sensor signal may be a magnetic flowmeter signal indicative of a voltage potential between two electrodes disposed on the interior of a tube. The method may further include using the processed signal to control a flow rate of a fluid flowing through the tube. The representative value may be a moving average of the process sensor signal, the moving average calculated from a plurality of discrete process sensor signal measurements.
The spurious noise threshold may include a dynamic threshold and a minimum threshold, the dynamic threshold varying over time in response to variations of the process sensor signal, and the minimum threshold establishing a floor beneath which the dynamic threshold may not fall. The method may include determining a relaxation time during which the process sensor signal is not replaced with the representative value even when the calculated value of the process sensor signal exceeds the spurious noise threshold. The method may further include setting a spurious noise timer to prevent the process sensor signal from being replaced with the representative value for more than a predetermined amount of time.
In another aspect, a system for filtering a signal according to the principles of the invention includes: means for determining a spurious noise threshold; means for receiving a process sensor signal; means for determining a representative value of the process sensor signal; and means for replacing the process sensor signal with the representative value when a calculated value of the process sensor signal exceeds the spurious noise threshold, thereby providing a processed signal.
In this aspect, the process sensor signal may be a magnetic flowmeter signal. The system may further include means for using the processed signal to control a flow rate. The representative value may be a moving average of the process sensor signal. The spurious noise threshold may include a dynamic threshold and a minimum threshold. The system may further include means for determining a relaxation time during which the process sensor signal is not replaced with the representative value even when the calculated value of the process sensor signal exceeds the spurious noise threshold. The system may include means for setting a spurious noise timer to prevent the process sensor signal from being replaced with the representative value for more than a predetermined amount of time.
In another aspect, a computer program product for filtering a signal according to the principles of the invention includes: machine executable code to determine a spurious noise threshold; machine executable code to receive a process sensor signal; machine executable code to determine a representative value of the process sensor signal; and machine executable code to replace the process sensor signal with the representative value when a calculated value of the process sensor signal exceeds the spurious noise threshold, thereby providing a processed signal.
In this aspect, the process sensor signal may be a magnetic flowmeter signal. The computer program product may include machine executable code to use the processed signal to control a flow rate. The representative value may be a moving average of the process sensor signal. The spurious noise threshold may include a dynamic threshold and a minimum threshold. The computer program product may further include machine executable code to determine a relaxation time during which the process sensor signal is not replaced with the representative value even when the calculated value of the process sensor signal exceeds the spurious noise threshold. The computer program product may further include machine executable code to set a spurious noise timer to prevent the process sensor signal from being replaced with the representative value for more than a predetermined amount of time.
In another aspect, a magnetic flowmeter system according to the principles of the invention includes: a tube having an outside wall and an inside wall; a plurality of magnetic coils around the outside wall of the tube; a pair of electrodes on the inside wall of the tube; a processor electrically connected to the plurality of magnetic coils and the pair of electrodes, the processor configured to periodically energize the plurality of magnetic coils, and further configured to periodically measure a voltage potential between the pair of electrodes; the processor further configured to provide a filtered signal, the filtered signal being generated by replacing the voltage potential with a synthesized voltage potential each time that a voltage deviation exceeds a spurious noise threshold; and the processor further configured to calculate a flow rate through the tube using the filtered signal.
In this aspect, the processor may be further configured to use the flow rate to control a process. The synthesized voltage potential may be a moving average of the voltage potential, the moving average calculated from a plurality of discrete voltage potential measurements. The spurious noise threshold may include a dynamic threshold and a minimum threshold, the dynamic threshold varying over time in response to variations of the voltage potential, and the minimum threshold establishing a floor beneath which the dynamic threshold may not fall. The processor may be further configured to determine a relaxation time during which the voltage potential is not replaced with the synthesized voltage potential even when the voltage deviation exceeds the spurious noise threshold. The processor may be further configured to set a spurious noise timer to prevent the voltage potential from being replaced with the synthesized voltage potential for more than a predetermined amount of time. The processor may be further configured to prevent the voltage potential from being replaced with the synthesized voltage potential when a coil current deviation exceeds a predetermined coil deviation threshold.